package com.turing.data.scripts.contract.transfer

import com.turing.data.vo.out.review.DependParamsVO
import com.turing.data.vo.out.review.TaskElementVO


class IfBeforeAllNotAvailable_30181_10_transfer {

    static List< TaskElementVO.DrawResultVO > doConvert(List< TaskElementVO.DrawResultVO > resultVOs, DependParamsVO dependParams){

        for (drawResultVO in resultVOs) {
                def childTaskSn = drawResultVO.childTaskSn
                if(null == childTaskSn || childTaskSn == ""){
                    continue
                }
            String modelValue = drawResultVO.text
            String REGEX_BEFORE = /.*资产管理计划成立前.*/
            String REGEX_AFTER_1 = /.*任何机构和个人不得动用投资者参与.*/
            String REGEX_AFTER_2 = /.*任何机构和个人不得动用.*/
            String str = modelValue.replaceAll("\n", "").replaceAll("\r", "")
            if ( str =~ REGEX_BEFORE || str =~ REGEX_AFTER_1 || str =~ REGEX_AFTER_2 ) {
                drawResultVO.businessValue =  "是"
                drawResultVO.type = 1
            } else {
                drawResultVO.businessValue = "否"
                drawResultVO.type = 1
            }
        }

        return resultVOs
    }
}
